package com.entor.springboot201912.controller;

import com.entor.springboot201912.model.Student;
import com.entor.springboot201912.service.StudentServiceI;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/sc")
public class StudentController {
    @Resource(name="studentService")//按名称注入 表示一个接口可以有多个实现类，通过名字指定那个实现类
    private StudentServiceI ssi;

    @RequestMapping("/find")
    @ResponseBody
    public List<Student> find(Student s){
        return ssi.find(s);
    }

    @RequestMapping("/index")
    public String index(){
        return "/student/index";
    }

}
